package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 需求信息
 */
@Entity
@Getter
@Setter
@ToString
@SuperBuilder
@ApiModel("需求信息")
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "requirement_info")
public class RequirementInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "title")
    @ApiModelProperty(value = "需求标题", required = true)
    @NotBlank(message = "需求标题不能为空")
    private String title;

    @ApiModelProperty("用户id")
    @Column(name = "user_id", nullable = false)
    private Long userId;

    @ApiModelProperty(value = "联系人姓名", required = true)
    @Column(name = "contact_name", nullable = false)
    @NotBlank(message = "联系人姓名不能为空")
    private String contactName;

    @ApiModelProperty(value = "联系人手机号", required = true)
    @Column(name = "contact_phone", nullable = false)
    @NotBlank(message = "联系人手机号不能为空")
    private String contactPhone;

    @ApiModelProperty("处理状态 0-待处理 1-处理中 2-完成 3-取消")
    @Column(name = "status", nullable = false)
    private String status;

    @ApiModelProperty("处理备注")
    @Column(name = "remark", nullable = true)
    private String remark;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

    @ApiModelProperty(value = "需求内容", required = true)
    @Column(name = "content", nullable = false)
    @NotBlank(message = "需求内容不能为空")
    private String content;

}
